Latest update: September 2017
This tutorial introduces the file features of FlashAir IoT Hub.
Using the file function, you can upload a picture taken from the camera containing FlashAir automatically to FlashAir IoT Hub and see the picture from the browser.
Select "File" on the screen to display a list of files uploaded from FlashAir.
In addition to the file name and the upload date, the thumbnail of the image file is displayed in the list, and the file other than the image is displayed the icon.
Clicking the thumbnail of an image Preview display, and download that file except images.
In FlashAir IoT Hub, the uploaded file has a retention period of one week, and it is automatically deleted
one week
after the upload date.
Please be careful.
When the file is deleted immediately, an icon indicating attention will be displayed as follows, so please use as a guide.
Click on the thumbnail image in the list to magnify and display the image.
If you put a check in the bottom right of the file, a menu will be displayed. If you click "Delete" from that menu, you can delete the checked file. Please note that deletion of files can not be undone.
If you put a check in the bottom right of the file, a menu will be displayed. You can download the checked file by clicking "Download" from that menu. If you select more than one file, compress it to a zip file and download it.
Here is an example of uploading photos taken with the camera to the FlashAir IoT Hub.
Please prepare to be able to connect from FlashAir to FlashAir IoT Hub in advance referring to Flow of use.
Edit the FlashAir CONFIG file. Please set the following value in
/SD_WLAN/CONFIG
.
LUA_SD_EVENT=/upload_image.lua
I have specified that Lua script to upload images be executed when writing files.
* If you do not upload images, please comment out
LUA_RUN_SCRIPT
in the CONFIG file. When Lua script specified by
LUA_RUN_SCRIPT
and
LUA_SD_EVENT
are executed at the same time, it may not work well.
When you insert FlashAir in the camera, it is ready. With this alone you can upload photos from the camera automatically!
Let's take a picture with a camera that actually inserted FlashAir and see the "file" of FlashAir IoT Hub.
* When shooting please go in a place where FlashAir can connect to the access point.
Photographs taken were uploaded to FlashAir IoT Hub automatically.
In this tutorial, I upload only newly shot pictures, but please upload all saved pictures to FlashAir and try to change them by devising them yourself.
Here is an example of uploading the video taken with the camera to FlashAir IoT Hub.
In the above I uploaded images, I think that sometimes I want to upload a video from a camera other than photos.
In such a case, let's upload the file from FlashAir in the following way.
Edit the FlashAir CONFIG file. Please set the following value in
/SD_WLAN/CONFIG
.
LUA_SD_EVENT=/upload_file.lua
I have specified that a Lua script to upload files should be executed when writing files.
* If you do not upload images, please comment out
LUA_RUN_SCRIPT
in the CONFIG file. When Lua script specified by
LUA_RUN_SCRIPT
and
LUA_SD_EVENT
are executed at the same time, it may not work well.
Finally, FlashAir is ready to insert in the camera.
Take a movie with the camera that inserted FlashAir and take a look at the "file" of FlashAir IoT Hub.
* When shooting please go in a place where FlashAir can connect to the access point.
* It may take time to upload videos.
Video uploaded! Please download and play the uploaded file.
In the example above, I uploaded an example of uploading movie files, but I think that you may want to upload a file of sensor data written in FlashAir as it is.
upload_file.lua
uploads the latest file under the
/DCIM
folder, but if you want to change this to an arbitrary folder, edit it as follows.
print("HTTP/1.1 200 Internal OK\n\n")
local last_fname = ""
local last_fpath = ""
local last_modif = 0
local last_moddir = 0
local last_dirname = "/DCIM"
local fpath = "/DCIM"
(snip)
last_dirname
,
fpath
to the folder path where the file you want to upload is written.
This will be able to automatically send sensor data from FlashAir.
Send a CSV file to the FlashAir IoT Hub and display it on a graph, or send the GPIO value etc. , We offer various ways to send data, so why not try it?